Skip to content

feat(dynatrace): add the write and configuration surfaces - #6398

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/dynatrace-expanded-surface
Aug 8, 2026
Merged

feat(dynatrace): add the write and configuration surfaces#6398
waleedlatif1 merged 3 commits into
stagingfrom
feat/dynatrace-expanded-surface

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Takes the Dynatrace block from 22 operations to 47, following up #6393. That PR shipped the read paths plus a few ingests; this closes the gaps that made those reads dead-end.

The one that was a real defect: security was read-only. The audit-vulnerabilities skill promised "a remediation queue" and then gave you no way to act on it, even though muting is the single most common triage action. Adds mute/unmute (single and bulk), the remediation items behind a third-party finding, and the Attacks API so an exploited vulnerability can be traced to the request that exploited it.

The rest, by how much they unblock:

  • Custom tags (read/add/delete) — entity tags already drive every selector in the block; writing them closes a loop that was half open.
  • Settings objects (schemas, list, get, create, update, delete) — how maintenance windows, alerting profiles, and management zones are configured in modern Dynatrace, so "open a maintenance window before the deploy" was unreachable before. The value is a schema-defined blob, so the tool is honestly opaque rather than falsely typed; the docs tell you to mirror an existing object. Update and delete carry the updateToken so a concurrent change fails instead of being silently overwritten.
  • Synthetic monitors + on-demand batch execution — pairs with the deploy-marker tool to gate a release on a smoke test.
  • Problem comment get/update/delete and SLO create/update/delete — completing CRUD that was half-built.

Two structural notes:

  • Synthetic monitors are the only endpoints still on Environment API v1, so buildDynatraceUrl grew a v1 sibling, the shared base-URL normalizer strips either version, and the query builder learned to repeat a param per value (Synthetic's tag needs it).
  • Creating an SLO returns 201 with an empty body and the new ID in the Location header, so that tool reads the header rather than parsing nothing.

Deliberately excluded: the Grail/DQL query API. It is the long-term successor to the deprecated logs/search endpoint, but it authenticates with a platform token rather than an Api-Token — a second auth path that belongs in its own change.

Type of Change

  • New feature

Testing

40 unit tests. New coverage: v1-vs-v2 routing for Synthetic, repeated tag params, bulk IDs accepted as list/JSON/comma-string, empty-batch rejection, the settings-create array wrapper, updateToken passthrough, create/update SLO producing identical bodies, the SLO Location-header read, 204-means-already-muted, and the documented top-level response key of every new list endpoint.

Full audit suite passes (tool-metadata:check, integration-catalog:check, check:api-validation:strict, both tool-boundary checks). Type-check and lint clean. A structural auditor verifies all 47 tools align three ways across dropdown, tools.access, and the registry, with no duplicate subBlock IDs and every required param reachable.

Not yet exercised against a live Dynatrace tenant — mappings are verified against the published API reference, not live payloads.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Takes the block from 22 operations to 47. The original PR shipped the read
paths plus a few ingests; this closes the gaps that made those reads
dead-end.

The one that was a real defect: security was read-only. The audit-vulnerabilities
skill promised "a remediation queue" and then gave you no way to act on it,
even though muting is the single most common triage action. Adds mute and
unmute, singly and in bulk, plus the remediation items behind a third-party
finding, plus the Attacks API so an exploited vulnerability can be traced to
the request that exploited it.

The rest, by how much they unblock:

- Custom tags (read/add/delete). Entity tags already drive every selector in
  the block; being able to write them closes a loop that was half open.
- Settings objects (schemas, list, get, create, update, delete). This is how
  maintenance windows, alerting profiles, and management zones are configured
  in modern Dynatrace, so "open a maintenance window before the deploy" was
  simply unreachable before. The value is a schema-defined blob, so the tool
  is honestly opaque rather than falsely typed; the docs tell you to mirror an
  existing object. Update and delete carry the updateToken so a concurrent
  change fails instead of being overwritten.
- Synthetic monitors and on-demand batch execution, which pairs with the
  deploy-marker tool to gate a release on a smoke test.
- Problem comment get/update/delete, and SLO create/update/delete, completing
  CRUD that was previously half-built.

Two structural notes. Synthetic monitors are the only endpoints still on
Environment API v1, so `buildDynatraceUrl` grew a v1 sibling and the shared
base-URL normalizer now strips either version; the query builder also learned
to repeat a param per value, which Synthetic's `tag` needs. And creating an
SLO returns 201 with an empty body and the new ID in the Location header, so
that tool reads the header rather than parsing nothing.

Deliberately excluded: the Grail/DQL query API. It is the long-term successor
to the deprecated logs/search endpoint, but it authenticates with a platform
token rather than an Api-Token, so it is a second auth path and belongs in
its own change.
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 8, 2026 1:28am

Request Review

@cursor

cursor Bot commented Aug 8, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Adds many write paths (settings delete, SLO delete, bulk mute, tag changes) against customer Dynatrace tenants using API tokens; behavior is well-tested but not validated against live tenants in the PR description.

Overview
Expands the Dynatrace integration from 22 to 47 operations, shifting the block from mostly read/query to full workflow coverage: security triage, configuration, deploy gating, and completed CRUD where it was partial.

Application Security adds mute/unmute (single and bulk), remediation items, and list/get attacks so vulnerabilities can be triaged and tied to runtime exploitation.

Entity tags gain list, add, and delete so selectors and management zones can be updated from workflows.

Settings adds full lifecycle for schema-backed objects (maintenance windows, alerting profiles, etc.), including updateToken on update/delete to avoid overwriting concurrent changes.

Synthetic adds list monitors (Environment API v1), on-demand batch execution, and batch polling for deploy smoke tests.

Problems and SLOs complete comment CRUD and SLO create/update/delete; SLO create reads the new ID from the Location header on an empty 201 body.

The Dynatrace block, docs, integration catalog, and 40 unit tests are updated; shared URL helpers now support v1 routing, repeated query params, and tri-state synthetic enabled filtering.

Reviewed by Cursor Bugbot for commit f830da9. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR expands the Dynatrace integration from read-oriented operations to comprehensive write and configuration support.

  • Adds security-problem muting, remediation-item retrieval, and attack inspection.
  • Adds tag, settings-object, synthetic-monitor, problem-comment, and SLO management.
  • Adds Environment API v1 routing, repeated query parameters, updated output schemas, generated metadata, documentation, and tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/dynatrace.ts Adds the new operation surfaces and parameter mappings, while correctly extending the required entity-selector condition to all three tag operations.
apps/sim/tools/dynatrace/utils.ts Extends shared URL and query construction to support Environment API v1 and repeated query parameters.
apps/sim/tools/dynatrace/dynatrace.test.ts Adds broad coverage for routing, request normalization, response contracts, concurrency tokens, and operation registration.
apps/sim/tools/dynatrace/types.ts Expands Dynatrace parameter and response types for the newly supported API surfaces.
apps/sim/tools/registry.ts Registers the new Dynatrace tools for runtime dispatch.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  B[Dynatrace Block] --> P[Parameter mapping]
  P --> T[Dynatrace tool registry]
  T --> V2[Environment API v2]
  T --> V1[Environment API v1]
  V2 --> S[Security, tags, settings, SLOs, comments]
  V1 --> Y[Synthetic monitors and batch execution]
Loading

Reviews (3): Last reviewed commit: "fix(dynatrace): make the synthetic enabl..." | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/dynatrace.ts
Comment thread apps/sim/blocks/blocks/dynatrace.ts
… selector

Two problems, one found in review and one worth more than it was given.

The tag operations could run without an entity selector. All three tag tools
declare `entitySelector` required, but the shared block field was only marked
required for List Entities, so the block let a workflow reach those tools with
an invalid configuration and let Dynatrace do the rejecting. My own structural
auditor missed it because it only checked that *some* visible subBlock existed
for a required param, not that the specific one was required — that check is
now precise, and it confirms these three were the only instances across all 47
operations.

The larger one: outputs were declaring `type: 'json'` for shapes the API
reference documents in full. Thirty-five of them. The top-level entities were
mapped properly, but nested payloads — a problem's evidence and impact
analysis, a vulnerability's risk assessment and global counts, an attack's
attacker, request, entry point and exploited vulnerability, a remediation
item's assessment and mute state, the synthetic execution and failure records,
the metric ingest error envelope, the DQL translation — were passed through as
anonymous blobs. A downstream block could not reference `attacker.sourceIp`
without knowing to guess it. All of those now carry their fields.

What stays opaque is now only what genuinely is, and each says why in its
description: a settings object's schema-defined value, an entity's
type-dependent property bag and relationship keys, caller-supplied synthetic
metadata, an audit log's JSON patch, the undocumented partial-success body of
log ingestion, and the handful of security-detail shapes the reference names
without expanding.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

1 issue from previous review remains unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 637b056. Configure here.

Review catch. `enabled` on List Synthetic Monitors is a three-way filter —
enabled, disabled, or either — and I had it as a switch. The URL builder
deliberately serializes `false` (there is a test pinning that `evaluate=false`
survives), so leaving "Enabled Only" unchecked sent `enabled=false` and
returned only the disabled monitors: exactly backwards.

Made it a dropdown with Any / Enabled only / Disabled only, matching the
monitorType field directly above it, which had the same shape and already used
an empty-id "Any" option. The params mapper sends nothing for "Any".

Checked the other nine switches rather than assuming. None share the bug: for
each of them off genuinely means false, and false is Dynatrace's own default,
so serializing it is correct. A test now pins that list so the trap cannot be
re-introduced by converting one of them, alongside a test covering all three
states of the filter.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f830da9. Configure here.

@waleedlatif1
waleedlatif1 merged commit d317607 into staging Aug 8, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/dynatrace-expanded-surface branch August 8, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant